package com.neca.auction.components;

import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.runtime.Component;

import com.neca.auction.pages.AddProduct;
import com.neca.auction.pages.AllProducts;
import com.neca.auction.pages.MyProducts;
import com.neca.auction.pages.Register;
import com.neca.auction.pages.Start;

public class Template {
	
	@Inject
	private ComponentResources resource;
	
	private String getPageName(){
		Component page=resource.getContainer();
		return page.getClass().getName();
	}
	
	public boolean isNotStart() 
    { 
      return !getPageName().equals(Start.class.getName()); 
    } 
	
	public boolean isNotRegister() 
    { 
      return !getPageName().equals(Register.class.getName()); 
    } 

   public boolean isAllProducts() 
    { 
      return getPageName().equals(AllProducts.class.getName()); 
    } 

   public boolean isAddProduct() 
    { 
      return getPageName().equals(AddProduct.class.getName()); 
    } 

   public boolean isMyProducts() 
    { 
      return getPageName().equals(MyProducts.class.getName()); 
    } 

}
